<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld"  prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld"  prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>

<%@ page import="org.apache.struts.action.Action"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.erp.framework.model.delegate.SimplePageEditStyleDelegate"%>
<%@ page import="com.erp.app.admin.sysLang.vo.SysLangVo"%>
<%@ page import="com.erp.app.admin.sysLang.criteria.SysLangSrchCriteria"%>
<%@ page import="com.erp.app.util.web.WebUtil"%>
<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.framework.util.CommonUtil"%>

<jsp:useBean id="loginForm" scope="request" type="com.erp.app.login.web.LoginForm" />
<script language="javascript">
	function openWin()
	{
		var t = (new Date()).getTime();

		var wide = window.screen.availWidth - 10;
		var height = window.screen.availHeight - 50;

		window.open('',t,'left=0, top=0, width='+wide+',height='+height+',resizable=yes,menubar=no,scrollbars=yes,status=yes');

		document.forms[0].target = t;
		window.opener = null;
		window.close();
	}

	function mouseOverLogin(img) {
		img.src = "images/menu/btn_login_over.png";
	}

	function mouseOutLogin(img) {
		img.src = "images/menu/btn_login_out.png";
	}
</script>
</script>

<script language="javascript" src="<%=request.getContextPath()+ "/js/sys.js" %>">
</script>

<link rel="stylesheet" href="<%=request.getContextPath()+ "/css/stylesheet-login.css" %>" type="text/css">

<%
String where = "";
String bgImageUrl = "/images/menu/login_bg.png";
String fontFace = "Arial, Helvetica, sans-serif";
String fontSize = "12px";

//Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
/*
SimplePageEditStyleDelegate dg = new SimplePageEditStyleDelegate();
SysLangSrchCriteria crit = new SysLangSrchCriteria();
ArrayList sysLangList = (ArrayList)dg.findByCriteria(new SysLangVo(), crit);
*/

String currentSysLangCode = (String)session.getAttribute(ProjectConstants.SESSION_SYSTEM_LANG);
%>

<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/stylesheet-login.css" type="text/css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<html:form action="/login" >
<html:hidden property="pageEvent" value="authenticate" />
<html:hidden property="pageEventSrc" />
<html:hidden property="pageMode" />
<html:hidden property="password2" />

<center>

	<div class="wrapper">
		<div class="top">
			<div class="welcome">Welcome to the CORE Business eXchange!</div>
			<div class="banner"><img src="images/top_bg.png" alt="CBX Software" style="background-image:url(images/top_bg.png)"/></div>
		</div>
		<div class="middle">			
	        <div class="left">
				<div class="container">
					<div class="cobranding_logo"></div>
					<h1>Login</h1>
					<p>Please enter your User ID and Password to login.</p>
				</div>
			</div>
			<div class="right">
				<div class="container">
					<form action="javascript:window.location.href='Main.html';" method="get">
						<table width="256" border="0" cellspacing="0" cellpadding="0">
							<tr style="display: none;">
								<td width=100></td>
								<td class="txtnormal" align=right>
									Company Code
									:
								</td>
								<td width=10></td>
								<td class="txtnormal">
									<select name="companyCode" class="selectBox1">
										<option value="">
										<chtml:options table="T_COMPANY"
													valuecolumn="COMPANY_CODE"
													textcolumn="SHORT_NAME"
													order="COMPANY_CODE"
													where=""
													selected="MS" />
									</select>
								</td>
								<td>
									&nbsp;
								</td>
							</tr>

							<tr>
								&nbsp;
							</tr>
							<tr>
								&nbsp;
							</tr>		
							<tr>

								<td>
								<label>User ID</label>
								<input name="userID" type="text" />	</td>
							</tr>

							<tr>
							  <td>
								<label>Password</label>
								<input name="password" type="password" />	</td>
							</tr>

							<tr style="display: none;">
								<td width=100></td>
								<td class="txtnormal" align=right>
									Language
									:
								</td>
								<td width=10></td>
								<td>
									<select name="sysLang" class="selectbox1">
										<chtml:options table="T_SYS_LANG"
										valuecolumn="LANG_CODE"
										textcolumn="LANG_NAME"
										order="ORDER_SEQ"
										selected="<%=loginForm.getSysLang()%>" />
									</select>
								</td>
								<td>
									&nbsp;
								</td>
							</tr>

							<tr>
								<td><input name="submit" type="submit" class="submit" value="Log in" /></td>
							</tr>


							<tr>
								<td colspan=5 height=100>
									<font color='red'><html:errors/></font>
								</td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
		<div class="bottom">
			<small>Copyright &copy;2006 Core Solutions Limited. All rights reserved.</small>
			<div class="powered">
				<a href="http://www.coresolutions.com" target="_blank"><img src="images/img_powered_by_core.png" alt="Powered by CORE" width="154" height="12" border="0" longdesc="http://www.coresolutions.com" /></a>
			</div>
		</div>
	</div>

</center>

</html:form>


<script language="JavaScript" type="text/javascript">
	<!--
		document.forms[0].elements["userID"].focus()
	// -->
</script>

</body>
</html>